{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "Run Metrics.ipynb",
      "provenance": [],
      "collapsed_sections": [],
      "toc_visible": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "MAJGY7J4Z1ix",
        "colab_type": "text"
      },
      "source": [
        "# Settings\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "tWXQFcZn-FzY",
        "colab_type": "code",
        "outputId": "60aeab11-1aa3-49ee-ab34-8b60d16c5a4c",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 54
        }
      },
      "source": [
        "%tensorflow_version 1.x\n",
        "import tensorflow as tf\n",
        "print(tf.version)"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "<module 'tensorflow._api.v1.version' from '/tensorflow-1.15.2/python3.6/tensorflow_core/_api/v1/version/__init__.py'>\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "79zSyWeEKNLz",
        "colab_type": "code",
        "outputId": "85702c2b-9694-4fea-f7d6-d623cdc3294c",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 85
        }
      },
      "source": [
        "!nvcc --version"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "nvcc: NVIDIA (R) Cuda compiler driver\n",
            "Copyright (c) 2005-2019 NVIDIA Corporation\n",
            "Built on Sun_Jul_28_19:07:16_PDT_2019\n",
            "Cuda compilation tools, release 10.1, V10.1.243\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "8QPGP6kqYIjq",
        "colab_type": "text"
      },
      "source": [
        "## Get attribute score/latent code pairs"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "4SeghIr9wsp-",
        "colab_type": "code",
        "outputId": "1d44e17e-b493-495d-99a6-818f29a752f2",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        }
      },
      "source": [
        "cd stylegan/"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "/content/Stylegan-Custom\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "e0FcTWTAyTAp",
        "colab_type": "code",
        "outputId": "053dd321-7e42-4f16-bf1a-b1c9347d857c",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 85
        }
      },
      "source": [
        "ls"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "\u001b[0m\u001b[01;32mconfig.py\u001b[0m*            \u001b[01;32mLICENSE.txt\u001b[0m*            \u001b[01;32mrun_metrics.py\u001b[0m*\n",
            "\u001b[01;32mdataset_tool.py\u001b[0m*      \u001b[01;34mmetrics\u001b[0m/                \u001b[01;32mstylegan-teaser.png\u001b[0m*\n",
            "\u001b[01;34mdnnlib\u001b[0m/               \u001b[01;32mpretrained_example.py\u001b[0m*  \u001b[01;34mtraining\u001b[0m/\n",
            "\u001b[01;32mgenerate_figures.py\u001b[0m*  \u001b[01;32mREADME.md\u001b[0m*              \u001b[01;32mtrain.py\u001b[0m*\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab_type": "code",
        "outputId": "d06d2d48-833c-4de0-bed4-b844c8e250ee",
        "id": "xx0_IGmQ-xDm",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 751
        }
      },
      "source": [
        "!python run_metrics.py"
      ],
      "execution_count": 0,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/tfutil.py:34: The name tf.Dimension is deprecated. Please use tf.compat.v1.Dimension instead.\n",
            "\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/tfutil.py:74: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.\n",
            "\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/tfutil.py:128: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.\n",
            "\n",
            "Creating the run dir root: results\n",
            "Creating the run dir: results/00000-run_metrics.run_pickle-ls-1gpu\n",
            "Copying files to the run dir\n",
            "dnnlib: Running run_metrics.run_pickle() on localhost...\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/tfutil.py:97: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.\n",
            "\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/tfutil.py:109: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.\n",
            "\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/tfutil.py:132: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.\n",
            "\n",
            "Evaluating ls metric on network_pkl \"https://drive.google.com/uc?id=1opTWG1jYlyS9TXAuqVyVR68kQWhOhA99\"...\n",
            "\n",
            "Downloading https://drive.google.com/uc?id=1opTWG1jYlyS9TXAuqVyVR68kQWhOhA99 .... done\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/network.py:142: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.\n",
            "\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/network.py:150: The name tf.AUTO_REUSE is deprecated. Please use tf.compat.v1.AUTO_REUSE instead.\n",
            "\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/tfutil.py:76: The name tf.VariableScope is deprecated. Please use tf.compat.v1.VariableScope instead.\n",
            "\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/network.py:151: The name tf.get_variable_scope is deprecated. Please use tf.compat.v1.get_variable_scope instead.\n",
            "\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/network.py:154: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.\n",
            "\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/network.py:182: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.\n",
            "\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/dnnlib/tflib/tfutil.py:200: The name tf.assign is deprecated. Please use tf.compat.v1.assign instead.\n",
            "\n",
            "WARNING:tensorflow:From <string>:364: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.\n",
            "Instructions for updating:\n",
            "Use tf.where in 2.0, which has the same broadcast rule as np.where\n",
            "WARNING:tensorflow:From /content/Stylegan-Custom/metrics/linear_separability.py:123: The name tf.random_normal is deprecated. Please use tf.random.normal instead.\n",
            "\n",
            "Downloading https://drive.google.com/uc?id=1jC0-scYn2kvlD1TMjiLMGO1uXTDzQ2hy ... done\n",
            "...jYlyS9TXAuqVyVR68kQWhOhA99  time 12m 19s     \n",
            "\n",
            "dnnlib: Finished run_metrics.run_pickle() in 12m 20s.\n"
          ],
          "name": "stdout"
        }
      ]
    }
  ]
}